<!-- Panel -->
<div id="toppanel">
    <div id="panel">
        <div class="content clearfix">
            <div class="left">
                <h1>PICKS Login Panel</h1>
                <h2>Register or login</h2>
            </div>

            <?php $this->model->LoginPanalStartscript(); ?>
            <?php if (!UserAccess::checkLoggedin()): ?>

                <div class="left">
                    <!-- Login Form -->
                    <form class="clearfix" action=<?php echo URL . "login/login" ?> method="post">
                        <h1>Member Login</h1>
                        <?php
                        if ($_SESSION['msg']['login-err']) {
                            echo '<div class="err">' . $_SESSION['msg']['login-err'] . '</div>';
                            unset($_SESSION['msg']['login-err']);
                        }
                        ?>
                        <label class="grey" for="usernamelogin">Username:</label>
                        <input class="field" type="text" name="username" id="usernamelogin" value="" size="23" />
                        <label class="grey" for="password">Password:</label>
                        <input class="field" type="password" name="password" id="password" size="23" />
                        <label><input name="rememberMe" id="rememberMe" type="checkbox" checked="checked" value="1" /> &nbsp;Remember me</label>
                        <div class="clear"></div>
                        <input type="submit" name="submit" value="Login" class="bt_login" />
                    </form>
                </div>
                <div class="left right">
                    <!-- Register Form -->
                    <form action=<?php echo URL . "login/register" ?> method="post">
                        <h1>Not a member yet? Sign Up!</h1>

                        <?php
                        if ($_SESSION['msg']['reg-err']) {
                            echo '<div class="err">' . $_SESSION['msg']['reg-err'] . '</div>';
                            unset($_SESSION['msg']['reg-err']);
                        }

                        if ($_SESSION['msg']['reg-success']) {
                            echo '<div class="success">' . $_SESSION['msg']['reg-success'] . '</div>';
                            unset($_SESSION['msg']['reg-success']);
                        }
                        ?>

                        <label class="grey" for="username">Username:</label>
                        <input class="field" type="text" name="username" id="username" value="" size="23" />
                        <label class="grey" for="email">Email:</label>
                        <input class="field" type="text" name="email" id="email" size="23" />
                        <label>A password will be e-mailed to you.</label>
                        <input type="submit" name="submit" value="Register" class="bt_register" />
                    </form>
                </div>

                <?php
            else:
                ?>

                <div class="left">
                    <!-- Change password Form -->
                    <form class="clearfix" action="<?php echo URL . "login/changepassword" ?>" method="post">
                        <h1>Change Password</h1>

                        <?php
                        if ($_SESSION['msg']['newpassword-err']) {
                            echo '<div class="err">' . $_SESSION['msg']['newpassword-err'] . '</div>';
                            unset($_SESSION['msg']['newpassword-err']);
                        }
                        ?>

                        <label class="grey" for="currentpassword">Current password:</label>
                        <input class="field" type="password" name="currentpassword" id="currentpassword" size="23" />
                        <label class="grey" for="newpassword">New password:</label>
                        <input class="field" type="password" name="newpassword" id="newpassword" size="23" />
                        <label class="grey" for="repeatnewpassword">Repeat new password:</label>
                        <input class="field" type="password" name="repeatnewpassword" id="repeatnewpassword" size="23" />
                        <div class="clear"></div>
                        <input type="submit" name="submit" value="Change" class="bt_newpassword" />
                    </form>
                    <a href="<?php echo URL ?>login/logout">Log off</a>

                </div>

                <div class="left right"></div>

            <?php
            endif;
            ?>

        </div>
    </div> <!-- /login -->

    <!-- The tab on top -->
    <div class="tab">
        <ul class="login">
            <li class="left">&nbsp;</li>
            <li>Hello <?php echo $_SESSION['username'] ? $_SESSION['username'] : 'Guest'; ?>!</li>
            <li class="sep">|</li>
            <li id="toggle">
                <a id="open"  class="open" ><?php echo ($_SESSION['username']) ? 'Open Panel' : 'Log In | Register'; ?></a>
                <a id="close" class="close" style="display: none;" >Close Panel</a>        
            </li>
            <li class="right">&nbsp;</li>
        </ul>
    </div> <!-- tab -->



</div> <!--panel -->

<div class="pageContent">
    <div id="main">
        <div class="container">
            <h1>PICKS for UEFA EURO 2012</h1>
        </div>
        <div class="container">
            <h2>
            <a class="HeadSelector" href="<?php echo URL.'login' ?>">Home</a>
            <?php if (UserAccess::checkLoggedin()) { ?>
            <a class="HeadSelector" href="<?php echo URL.'picks' ?>">Set Picks</a>  
            <a class="HeadSelector" href="<?php echo URL.'viewer' ?>">View Picks</a>  
            <?php if($_SESSION['admin'] == 1) { ?>
                <a class="HeadSelector" href="<?php echo URL.'admin' ?>">Admin</a>  
            <?php } }?>
            </h2>
            <hr />